#!/usr/bin/env python
#coding: utf-8
'''
Created on 2017年4月17日

@author: Administrator
'''


from django.conf import settings
from common import settings as common_settings

# 管理邮件发送邮箱账号
ADMIN_EMAIL_HOST_USER = settings.EMAIL_HOST_USER
# 公共邮件发送邮箱账号
PUBLIC_EMAIL_HOST_USER = settings.EMAIL_HOST_USER

EMAIL_HOST_USER = settings.EMAIL_HOST_USER
SYSTEM_MESSAGE_USER = settings.EMAIL_HOST_USER

SYSTEM_USER = settings.EMAIL_HOST_USER

ADMINS = settings.ADMINS

EMAIL_TYPE_CHOICES=(
    (0,"系统邮件"),
)

SMS_TYPE_CHOICES=(
    (0,"系统短信"),
)


# 错误码分配
ERROR = {
    'MESSAGE_UPDATE_LIMIT_ERR': {'code': '25001', 'msg': u'消息数量超出限制'},
    'OUT_OF_INTERVAL_LIMIT': {'code': '25002', 'msg': u'验证码已失效'},
    'PHONE_OR_EMAIL_FORMATE_ERROR': {'code': '25003', 'msg': u'手机或邮箱格式错误'},
    'TIME_LT_INTERVAL': {'code': '25004', 'msg': u'请稍等一会儿再点击'},
    'IP_COUNT_FULL': {'code': '25005', 'msg': u'当前时段发送数已满，请稍后操作'},
}
ERROR.update(settings.ERROR)

StateEnum = common_settings.StateEnum

class MessageCategoryEnum:
    NORMAL = 0  # 普通消息
    LETTER = 1  # 私信
    SYSTEM = 2  # 系统通知

MESSAGE_CATEGORY_CHOICES = (
    (MessageCategoryEnum.NORMAL, u'普通消息'),
    (MessageCategoryEnum.LETTER, u'私信'),
    (MessageCategoryEnum.SYSTEM, u'系统通知'),
)

VALIDATE_CATEGORY = (
    (0, u'手机验证'),
    (1, u'邮箱验证'),
)

# 消息数据缓存
USER_MESSAGES_CACHE_KEY_PREFIX = "user.messages"
USER_MESSAGES_CACHE_TIMEOUT = 24 * 60 * 60

# 每天短信超过200条后报警
SMS_DAILY_COUNT = 'message.sms.daily.count'

# 批量操作的消息数量上限
MESSAGE_UPDATE_MANY_LIMIT = 100

# 用户未读消息数量缓存
USER_MESSAGE_CACHE_KEY = 'user.%(user_id)s.message'
USER_MESSAGE_CACHE_TIMEOUT = 7 * 24 * 60 * 60

# 短息接口账号密码
MESSAGE_SMS_ACCOUNT = ''
MESSAGE_SMS_PASSWORD = ''
MESSAGE_SMS_SEND_API = ''
